<div id="root">
  <button @click="increment">{{titleCount}}</button>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/3.0.2/vue.global.prod.js"></script>
<script>
  const { createApp, computed, ref } = Vue;
  const App = {
    setup() {
      const title = ref("快来点击吧");
      const count = ref(0);
      const titleCount = computed(() =>
        count.value === 10 ? (title.value = "您点击了10次啦") : count.value
      );
      const increment = () => count.value++;
      return { titleCount, increment };
    },
  };
  const app = Vue.createApp(App);
  app.mount("#root");
</script>
